package com.ck567.practice.mybatisplus.service;

import com.ck567.practice.mybatisplus.mapper.ArticleMapper;
import com.ck567.practice.mybatisplus.modle.Article;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class ArtivleServiceImpl {
//  @Resource
//  protected Mapper dozerMapper;

  @Resource
  private ArticleMapper articleMapper;


  //新增
  public  void saveArticle(Article article) {
//    Article articlePO = dozerMapper.map(article,Article.class);
    articleMapper.insert(article);
  }

  //删除
  public void deleteArticle(Long id) {
    articleMapper.deleteById(id);
  }

//  //更新
//  public void updateArticle(Article article) {
//    Article articlePO = dozerMapper.map(article,Article.class);
//    articleMapper.updateById(articlePO);
//  }
//
//  //查询
//  public Article getArticle(Long id) {
//    return dozerMapper.map(articleMapper.selectById(id),ArticleVO.class);
//  }
//
//  //查询所有
//  public List<Article> getAll() {
//    List<Article> articles = articleMapper.selectList(null);
//    return DozerUtils.mapList(articles,Article.class);
//  }

  public static void main(String[] args) {

  }
}